<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/


//前台页面的路由
Route::get('/','Home\IndexController@index');//首页路由
Route::get('/cate/{cate_id}','Home\IndexController@cate');//列表页的路由
Route::get('/a/{art_id}','Home\IndexController@article');//文章页的路由

//登录路由
Route::any('admin/login', 'Admin\LoginController@login');//登录路由
Route::get('admin/code', 'Admin\LoginController@code');//验证码路由


//后台路由组（验证是否登录）
Route::group(['middleware' => ['admin.login'],'prefix'=>'admin','namespace'=>'Admin'], function () {
    Route::get('index', 'IndexController@index');//后台首页路由
    Route::get('info', 'IndexController@info');//后台中间iframe
    Route::get('quit', 'LoginController@quit');//退出路由
    Route::any('pass','IndexController@pass');//修改密码路由

    Route::post('cate/changeorder','CategoryController@change_order');//修改分类排序路由

    Route::any('upload','CommonController@upload');//上传文件路由

    Route::resource('category','CategoryController');//分类控制器的资源路由
    Route::resource('article','ArticleController');//文章控制器的资源路由
    
    Route::resource('links','LinksController');//友情链接控制器的资源路由
    Route::post('links/changeorder','LinksController@change_order');//友情链接的排序路由

    Route::resource('navs','NavsController');//自定义导航资源路由
    Route::post('navs/changeorder','NavsController@change_order');//导航的排序路由

    Route::resource('config','ConfigController');//配置项资源路由
    Route::post('config/changeorder','ConfigController@change_order');//网站配置的排序路由
    Route::post('config/changecontent','ConfigController@change_content');//改变配置内容路由
    Route::get('conf/putfile','ConfigController@putFile');//写入文件的路由
    
    

});

